<taglib name='article,Html'/>
<script src="__PUBLIC__/jsLibrary/Jslibary.js"></script>
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://lib.sinaapp.com/js/jquerytools/1.2.5/jquery.tools.min.js"></script>
<link href="/css/otherall.css" type="text/css" rel="stylesheet" />
<div class="top_s">
            <div class="top">
               <div id="scrollDiv">
                <li>
                  <volist name="userlist" id="vo">
                 	 <p>欢迎<a  href="/user/?<{$vo.uid}>"><strong><{$vo.username}></strong></a>入驻本网</p>
                  </volist>
                   <volist name="bloglist" id="vo">
                 	 <p><a  href="/user/space.php?uid=<{$vo.uid}>&do=blog&id=<{$vo.blogid}>"><{$vo.username}>刚刚发表了:<{$vo.subject}></a></p>
                  </volist>
                </li>
                </div>
                <li class="top_right">
                    <span><a href="#" >说说</a></span>
                    <span><a href="#" >景点</a></span>
                    <span><a href="#" >攻略</a></span>
                    <span><a href="/user/space.php?uid=0&do=share&view=all&type=blog" >游记</a></span>
                    <span><a href="/user/space.php?uid=0&do=share&view=all&type=mtag" >小组</a></span>
                    <span><a href="/user/space.php?uid=0&do=share&view=all&type=event" >活动</a></span>
                </li>
            </div>
        </div>
<div class="Logo_top">
            <div class="logo_1"><a href="http://www.dreams-travel.com/" ><img src="__PUBLIC__/images/logo.gif" alt="梦之旅" border="0" /></a></div>
            <div id="backgroundHolder"> 
                <ul class="nav"> 
                    <li class="nav1 drop"><a class="main" href="/" >首页</a></li> 
                    <li class="nav2 drop"><a class="main down" href="#url" >我要去旅游</a> 
                        <ul> 
                            <li><a href="#url"  class="nav_bg">周边旅游</a></li> 
                            <li><a href="/domestic"  class="nav_bg">国内旅游</a></li> 
                            <li><a href="/abroad"  class="nav_bg2">出境旅游</a></li> 
                        </ul> 
                    </li> 
                    <li class="nav3 drop"><a class="main down" href="#url" >旅游服务</a> 
                        <ul> 
                            <li><a href="#url"  class="nav_bg">说说</a></li>
                            <li><a href="#url"  class="nav_bg2">说说</a></li> 
                        </ul> 
                    </li>
                    <li class="nav5 drop" ><a class="main" href="#url">梦想团</a></li> 
                    <li class="nav4 drop"><a class="main down" href="#url" >应用</a> 
                        <ul> 
                            <li><a href="#url"  class="nav_bg">旅途吼吼</a></li>
                            <li><a href="#url"  class="nav_bg">游记攻略</a></li>
                            <li><a href="#url"  class="nav_bg">景色景彩</a></li>
                            <li><a href="#url"  class="nav_bg">旅途问问</a></li>
                            <li><a href="#url"  class="nav_bg2">+添加应用</a></li> 
                        </ul> 
                    </li> 
                </ul> 
            </div>
            
            <div class="logo_3" id="userinfo">
                <php>
                if($_COOKIE["uchome_auth"].""=="")
                {
                </php>
                    <ul>
                        <li class="yh">
                            <span id="userlogin">我要登陆</span>
                        </li>
                    </ul>
                <php> } else {</php>
                	<ul>
                         <li class='yh'>
                           <span><a href='__UCHOME__/?<{$Think.const.__USERID__}>' target='_blank'><img width="30" height="30" src='<{$Think.cookie.uchome_usertouxiang}>' onerror="this.onerror=null;this.src='http://demo.mzl5.com/ducenter/images/noavatar_small.gif'"  alt='用户头像' /></a>&nbsp;<a href='__UCHOME__/?<{$Think.const.__USERID__}>' target='_blank' id='ausername'><{$Think.const.__USERNAME__}></a></span>
                          <span><a href='__UCHOME__/?<{$Think.const.__USERID__}>' target='_blank'><img src='/images/jb.jpg' alt='金币' /></a>&nbsp;<a href='__UCHOME__/?<{$Think.const.__USERID__}>' target='_blank' id='ajifen'><{$Think.cookie.uchome_credit}></a></span>
                        </li>
                           <li class='lj'>
                            <span><a href='__UCHOME__' target='_blank'>订单</a></span>
                          <span><a href='__UCHOME__/cp.php?ac=invite' target='_blank'>邀请</a></span>
                         <span><a href='__UCHOME__/cp.php?ac=task' target='_blank'>任务</a></span>
                           <span><a href='__UCHOME__/cp.php?ac=magic' target='_blank'>道具</a></span>
                           <span><a href='__UCHOME__/cp.php' target='_blank'>设置</a></span>
                           <span><a href='__UCHOME__/cp.php?ac=common&op=logout&uhash=<{$Think.cookie.uchome_uhash}>' target='_blank'>退出</a></span>
                         </li>
                      </ul>
                
                <php> }</php>
                
          </div>
        </div>
<div id="chendiv_fade" class="chen_black_overlay" style="display:none; height:100%">
</div>
<div id="chendiv_userlogin" class="chen_white_content" style="display:none;">
    <div style="text-align: right; cursor: default; height: 40px;">
    	<span style="font-size: 16px;cursor:hand;" onclick="chen_CloseDiv('chendiv_userlogin','chendiv_fade')">关闭</span>
        <div>
        用户名:<input name="username" and id="username" type="text" />
        密码:<input name="password" and id="password" type="text" />
        <input name="btnuserlogin" id="btnuserlogin" type="button" value="登 陆" />
        </div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
	$("#userlogin").bind("click",function(){
		chen_ShowDiv("chendiv_userlogin","chendiv_fade");
	});
	
	$("#btnuserlogin").bind("click",function(){
		username=$("#username").val();
		password=$("#password").val();
		if(!username.match(/[\S]+/))
		{
			alert("请输入正确的用户名");
			$("#username").focus();
			return false;
		}
		if(!password.match(/[\S]+/))
		{
			alert("密码不能为空");
			$("#password").focus();
			return false;
		}
		
		
		
		//使用ajax去登陆社区 /?m=public&a=ajaxuserlogin
		$.ajax({
		  url: "/index.php?m=public&a=ajaxuserlogin&username="+username+"&password="+password,
		  cache: false,
		  success: function(html){
			var getuser=html;
			if(html.length<10)
			{
			alert("登陆失败,请重新填写用户名和密码");
			return false;	
			}
			
			userurl="__UCHOME__";
			//获取用户名
			
			username=getkuohaostr(html,/\"username\"\:\"([\s\S]*?)\"/);
			uid=getkuohaostr(html,/\"uid\"\:\"([\s\S]*?)\"/);
			credit=getkuohaostr(html,/\"credit\"\:\"([\s\S]*?)\"/);//积分
			usertouxiang=getkuohaostr(html,/\"usertouxiang\"\:\"(http?[\s\S][^\"]+[gif|jpg|png])/);
			usertouxiangb=getkuohaostr(html,/\"usertouxiangb\"\:\"(http?[\s\S][^\"]+[gif|jpg|png])/);
			uhash=getkuohaostr(html,/\"uhash\"\:\"([\s\S]*?)\"/);
			
			loginedhtml="<ul>"
            loginedhtml+=" <li class='yh'>"
            loginedhtml+=""
            loginedhtml+="      <span><a href='"+userurl+"/?"+uid+"' target='_blank'><img src='"+usertouxiang+"' onerror=\"this.onerror=null;this.src='"+usertouxiangb+"'\" width=30 height=30 alt='用户头像' /></a>&nbsp;<a href='' target='_blank' id='ausername'>"+username+"</a></span>"
            loginedhtml+="       <span><a href='"+userurl+"/?"+uid+"' target='_blank'><img src='/images/jb.jpg' alt='金币' /></a>&nbsp;<a href='"+userurl+"' target='_blank' id='ajifen'>"+credit+"</a></span>"
            loginedhtml+="    </li>"
             loginedhtml+="   <li class='lj'>"
             loginedhtml+="   	<span><a href='"+userurl+"' target='_blank'>订单</a></span>"
             loginedhtml+="       <span><a href='"+userurl+"/cp.php?ac=invite' target='_blank'>邀请</a></span>"
             loginedhtml+="       <span><a href='"+userurl+"/cp.php?ac=task' target='_blank'>任务</a></span>"
              loginedhtml+="       <span><a href='"+userurl+"/cp.php?ac=magic' target='_blank'>道具</a></span>"
              loginedhtml+="          <span><a href='"+userurl+"/cp.php' target='_blank'>设置</a></span>"
             loginedhtml+="           <span><a href='"+userurl+"/cp.php?ac=common&op=logout&uhash="+uhash+"' target='_blank'>退出</a></span>"
             loginedhtml+="       </li>"
            loginedhtml+="    </ul>";
			
			
			//登陆成功时，刷新出发地菜单
				tourl="/public/showuserchufadi-uid-"+uid;
				$.ajax({
						  url: tourl,
						  cache: false,
						  success: function(html){
							 ml=getkuohaostr(html,/\<item key=0\>([\s\S]+)?<\/item\>/)
							 menufrist=html.match(/\<item key=0\>[\s\S]+?<\/item>/);
							 othermenu=html.replace(menufrist,"");
							 $("#chooseedlist_0").empty();
							 $("#chooseedlist_0").append(ml);
							 $("#dz").empty();
							 $("#dz").append(othermenu);
					   }
				});
			alert("登陆成功");
			//执行生成cookie
			var getuser=getuser.match(/^[\s\S]+(?!returnrecord\=)/);
			$("#userinfo").html(loginedhtml+"<div style='display:none'>"+getuser+"</div>");
			chen_CloseDiv('chendiv_userlogin','chendiv_fade');
		  }
		});
	});
	setInterval("AutoScroll('#scrollDiv')",2700);
});

function AutoScroll(obj){
$(obj).find("li:first").animate({
	marginTop:"-25px"},500,function(){
		$(this).css({marginTop:"0px"}).find("p:first").appendTo(this);
	});
}

</script>